import request from '@/utils/request'

export default {
    //条件查询分页  讲师列表
    //page 当前页；limit 每页记录数； teacherQuery 条件对象
    getTeacherListPage(page, limit, teacherQuery) {
        return request({
            url: `/eduservice/teacher/pageTeacherCondition/${page}/${limit}`,
            method: 'post',
            //teacherQuery 条件对象,后端使用RequestBody获取数据
            data: teacherQuery
        })
    },

    //删除讲师
    delTeacherById(id) {
        return request({
            url: `/eduservice/teacher/removeTeacherById/${id}`,
            method: 'delete'
        })
    },

    //添加讲师
    addTeacher(teacher) {
        return request({
            url: `/eduservice/teacher/saveTeacher`,
            method: 'post',
            data: teacher
        })
    },

    //根据id查询讲师
    getTeacherById(id){
        return request({
            url: `/eduservice/teacher/getTeacherById/${id}`,
            method: 'get'
        })
    },

    //修改讲师
    updateTeacher(teacher){
        return request({
            url: `/eduservice/teacher/updateTeacher`,
            method: 'post',
            data: teacher
        })
    },

    findAll(){
        return request({
            url: `/eduservice/teacher/findAll`,
            method: 'get'
        })
    }
}